﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data ;
using libDAL;
using libInventory.dbml;
using Telerik.WinControls.Data;
using Telerik.WinControls.UI;
using Telerik.WinControls.RichTextBox;
using Telerik.WinControls.RichTextBox.Model;

namespace libInventory.BUS
{
    sealed class clsInterfaceGRN : IDisposable 
    {
        private clsBUSGRN _BUS;
        private DataSet dsGRNMain;
        private string strGRNNo = string.Empty;
        private DataRow[] drGRNMain = { };

        public string getset_GRNNo
        {
            get
            {
                return _BUS.getset_GRNNo; 
            }
            set
            {
                _BUS.getset_GRNNo = value;
            }
        }

        public bool get_CheckCompanyWithGLNo(string strCompanyID)
        {
            return _BUS.get_CheckCompanyWithGLNo(strCompanyID);
        }

        public DataRow[] getset_GRNMainDetails
        {
            get
            {
                return _BUS.getset_GRNMainDetails;
            }
            set
            {
                _BUS.getset_GRNMainDetails = value;
            }
        }

        public bool set_UpdateShipperInvoice()
        {
            return _BUS.set_UpdateShipperInvoice();
        }

        public string getset_ConsigneeID
        {
            get
            {
                return _BUS.getset_ConsigneeID; 
            }
            set
            {
                _BUS.getset_ConsigneeID = value;
            }
        }

        public string getset_ShipperID
        {
            get
            {
                return _BUS.getset_ShipperID;
            }
            set
            {
                _BUS.getset_ShipperID = value;
            }
            
        }

        public bool set_TransferShipperInvoice(RadGridView dgvSource)
        {
            return _BUS.set_TransferShipperInvoice(dgvSource);
        }

        public DataRow[] getset_ShipperInvoice
        {
            get
            {
                return _BUS.getset_ShipperInvoice; 
            }
            set
            {
                _BUS.getset_ShipperInvoice = value;
            }
        }

        public DataRow[] getset_ShipperMeasurement
        {
            get
            {
                return _BUS.getset_ShipperMeasurement;
            }
            set
            {
                _BUS.getset_ShipperMeasurement = value;
            }
        }

        public DataRow[] getset_GenMeasurement
        {
            get
            {
                return _BUS.getset_GenMeasurement;
            }
            set
            {
                _BUS.getset_GenMeasurement = value;
            }
        }

        public DataRow[] get_ShipperAddress
        {
            get
            {
                return _BUS.get_ShipperAddress;
            }
        }

        public bool set_InsertUpdateRecordsLinqTfcargorec(string strPrimaryKey, tfcargorec liqCargorec)
        {
           return  _BUS.set_InsertUpdateRecordsLinqTfcargorec(strPrimaryKey, liqCargorec);
        }
        public DataRow[] get_ConsigneeAddress
        {
            get
            {
                return _BUS.get_ConsigneeAddress;
            }
        }

        public DataRow[] get_ShipperConsigneeAddress(string strCompanyID, string strShipperOrConsignee)
        {
            return _BUS.get_ShipperConsigneeAddress(strCompanyID, strShipperOrConsignee);
        }

        public string get_CodeName(string strcountrycitycompanystateareaport, string strID)
        {
            string strName = string.Empty;
            try
            {
                strName = _BUS.get_CodeName(strcountrycitycompanystateareaport, strID);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " get_CodeName");
            }
            return strName;
        }

        public clsInterfaceGRN()
        {
            _BUS = new clsBUSGRN();
         
        }

        


        public bool set_ShipperInvoice()
        {
            bool bolStatus = false;
            try
            {
                    bolStatus = _BUS.set_LoadShipperInvoice();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " set_ShipperInvoice");
            }
            return bolStatus;
        }

        public bool set_GeneralMeasurment()
        {
            bool bolStatus = false;
            try
            {
                    bolStatus = _BUS.set_GeneralMeasurment();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " set_GeneralMeasurment");
            }
            return bolStatus;
        }

        public bool set_ShipperMeasurment()
        { 
            bool bolStatus = false;
            try
            {
                    bolStatus = _BUS.set_ShipperMeasurment();
            }
            catch (Exception ex)
            {

            }
         return bolStatus;
        }

        public DataRow[] get_ShipperCompanyDetails(string strCompanyID)
        {
            return _BUS.get_ShipperCompanyDetails(strCompanyID);
        }

        public DataRow[] get_ConsigneeCompanyDetails(string strCompanyID)
        {
            return _BUS.get_ConsigneeCompanyDetails(strCompanyID);
        }

        public bool set_GRNMain()
        {
            bool bolStatus = false;
            try
            {
                 bolStatus = _BUS.set_GRNMain();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " clsInterfaceGRN_set_GRNMain");
            }
            return bolStatus;
        }

        public cls_DAL get_DAL_Enterprise
        {
            get
            {
                return _BUS.get_DAL_Enterprise;
            }
        }

        public cls_DAL get_DAL_Transactions
        {
            get
            {
                return _BUS.get_DAL_Transactions;
            }
        }


        public void Dispose()
        {
            GC.Collect();
            //throw new NotImplementedException();
        }

        internal bool set_TransferGeneralMeasurement(RadGridView dgvGenMeasurement)
        {
            return _BUS.set_TransferGeneralMeasurement(dgvGenMeasurement);
        }
    }
}
